<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
</head>
<body>
    <div id="box">
        <child>
            <!-- 新slot简写形式为# -->
            <template #a>
                <div>111111111111</div>
            </template>

            <template #b>
                <div>222222222222</div>
            </template>
        </child>

        <navbar>
            <template #left>
                    <div>
                        <button>返回</button>
                        <i>图标</i>
                    </div>
            </template>

           <template #right>
            <div>
                <button>搜索</button>
                <i>图标</i>
            </div>
           </template>
        </navbar>
    </div>
   
    <script type="text/javascript">
        Vue.component("child", {
            template:`
            <div>
                <slot name="a"></slot> 
                child
                <slot name="b"></slot>   
            </div>
            `
        })
        Vue.component("navbar", {
            template:`
            <div>
                <slot name="left"></slot>
                navbar
                <slot name="right"></slot>
            </div>
            `
        })


        new Vue ({
            el:"#box",
            data: {

            }
        })
    </script>
</body>
</html>